import Vue from 'vue'
import App from './App.vue'
import Vant from 'vant'
import 'vant/lib/index.css';
import router from './router'
import store from './store'
import axios from './http/index'
import './common/utils'
import './assets/icon/iconfont.css'
import './assets/icon/iconfont.js'
// import './common/utils'
Vue.use(Vant)
axios.get('/api/data1',{}).then(res=>{
  console.log(res)
})
Vue.config.performance = true
Vue.config.errorHandler=function (err,vm,info) {
  console.log(err,vm,info)
}
router.beforeEach((to,from,next) => {
  console.log(to)
  console.log(from)
  // if(to.path !== '/form') {
  //   next({path:'/form'})
  // }
  next()
})
router.afterEach((to,from) => {
  addEventListener('popstate',function(){
    console.log(123)
  })
  console.log(to)
  console.log(from)
  // next()
})
Vue.config.productionTip = false
Vue.prototype.$http = axios
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
